package com.fansl.allround.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/9/25 17:26
 */
@Getter
@AllArgsConstructor
public enum SexEnum {
    /**
     * 未知
     */
    UNKNOWN(0, "未知"),

    /**
     * 男
     */
    MALE(1, "男"),

    /**
     * 女
     */
    FEMALE(2, "女");

    /**
     * 类型
     */
    private final int type;
    /**
     * 描述
     */
    private final String description;

    public static SexEnum getByType(int type){
        for (SexEnum sexEnum:SexEnum.values()){
            if(sexEnum.getType()==type){
                return sexEnum;
            }
        }
        return UNKNOWN;
    }
}
